package com.example.chunqiubackend.service.impl;

import com.example.chunqiubackend.mapper.UserMapper;
import com.example.chunqiubackend.pojo.User;
import com.example.chunqiubackend.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.time.LocalDateTime;
import java.util.Date;

@Service
public class UserServiceImpl implements UserService {

    @Autowired
    private UserMapper userMapper;

    //根据邮箱查询用户
    @Override
    public User findByEmail(String email) {
        return userMapper.findByEmail(email);
    }

    //注册
    public void register(String email, String passwd, LocalDateTime update_time, LocalDateTime create_time){
        userMapper.register(email,passwd,update_time,create_time);
    }

    //修改密码
    @Override
    public void uppasswd(String email, String new_passwd,LocalDateTime update_time) {
         userMapper.uppasswd(email,new_passwd,update_time);
    }
}
